<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 练习一
    const spec = { color: '白色', size: '10寸', age: 20 }
    //用value方法把对象每个值转成数组，然后join转成字符串
    const val = Object.values(spec).join('/')
    console.log(val)

    // 练习二
    const gift = '50g茶叶,宝马,奔驰'
    //先用split转成数组，然后map映射，然后再次转成字符串
    const str = gift.split(',').map((item => `<p>【赠品】${item}</p>`)).join('')
    document.write(str)
  </script>
</body>

</html>